package com.study.ctripapollo.enums.user;

public enum SexEnum {
    MAN(1, "男"),
    WOMEN(2,"女");


    private Integer type;

    private String desc;

    public Integer getType() {
        return type;
    }
    public String getDesc() {
        return desc;
    }

    SexEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static SexEnum getSexEnum(int type) {
        for(SexEnum sexEnum : SexEnum.values()) {
            if (sexEnum.getType() == type) {
                return sexEnum;
            }
        }
        return null;
    }
}
